package cn.csc.module.pay.api.refund.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;

/**
 * 退款单创建 Request DTO
 *
 * @author
 */
@Data
@ApiModel("退款单创建 Request DTO")
public class PayRefundCreateReqDTO {

    /**
     * 应用编号
     */
    @NotNull(message = "应用编号不能为空")
    @ApiModelProperty(value = "应用编号", required = true, example = "1212")
    private BigInteger appId;
    /**
     * 商户编号
     */
    @ApiModelProperty(value = "商户编号", required = true, example = "1212")
    private BigInteger merchantId;
    /**
     * 用户 IP
     */
    @NotEmpty(message = "用户 IP 不能为空")
    @ApiModelProperty(value = "用户 IP", required = true, example = "12.12.132.36")
    private String userIp;

    // ========== 商户相关字段 ==========

    /**
     * 退款描述
     */
    @NotEmpty(message = "退款描述不能为空")
    @Length(max = 128, message = "退款描述长度不能超过128")
    @ApiModelProperty(value = "退款描述", required = true, example = "退款描述")
    private String reason;

    // ========== 订单相关字段 ==========

    /**
     * 支付单号
     */
    //@NotNull(message = "支付单号不能为空")
    @ApiModelProperty(value = "支付单号", example = "1750455031764688397")
    private BigInteger payOrderId;


    /**
     * 商户交易订单号
     */
    @NotEmpty(message = "商户交易订单号")
    @ApiModelProperty(value = "商户交易订单号", required = true, example = "cschz202401250946157")
    private String merchantOrderId;

    /**
     * 商户退款订单号，用于关联售后订单ID，TODO 暂时未投入使用
     */
    @ApiModelProperty(value = "商户退款订单号，用于关联售后订单ID，暂时未投入使用", example = "202401250946157")
    private String merchantRefundNo;


    /**
     * 退款金额，单位：分
     */
    @NotNull(message = "退款金额不能为空")
    @Min(value = 1, message = "退款金额必须大于零")
    @ApiModelProperty(value = "退款金额，单位：分", required = true, example = "100000")
    private Integer amount;
}